package com.xique.system.service.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xique.common.core.utils.StringUtils;
import com.xique.system.bean.domain.SystemUserRsa;
import com.xique.system.bean.search.SystemUserRsaSearch;
import com.xique.system.mapper.SystemUserRsaMapper;
import com.xique.system.service.service.ISystemUserRsaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author shd
 * @create 2021/11/18 10:05
 */
@Service
public class SystemUserRsaServiceImpl implements ISystemUserRsaService {

    @Autowired
    private SystemUserRsaMapper systemUserRsaMapper;

    @Override
    public SystemUserRsa selectSystemUserRsaBySearch(SystemUserRsaSearch search) {
        QueryWrapper<SystemUserRsa> wrapper = new QueryWrapper<>();
        if (StringUtils.isNotEmpty(search.getUserName())) {
            wrapper.like("user_name", search.getUserName());
        }
        wrapper.last("limit 1");
        return systemUserRsaMapper.selectOne(wrapper);
    }
}
